package com.leeon.exception.exmaples;

class StrException extends Exception{
    private String msg;
    public StrException(String msg){
        this.msg = msg;
    }
    public void pringMsg(){
        System.out.printf("msg : " + msg);
    }

}

public class Exmaple4 {

    public static void f() throws StrException{
        System.out.printf("throwing exception");
        throw new StrException("exception in f()");
    }

    public static void main(String[] args) {
        try {
            f();
        }catch (StrException e){
            e.printStackTrace(System.out);
        }
    }
}
